<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="selenium.base" href="http://mamsy.ru/" />
<title>N_of_stock_check</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
<tr><td rowspan="1" colspan="3">N_of_stock_check</td></tr>
</thead><tbody>
<tr>
	<td>open</td>
	<td>/</td>
	<td></td>
</tr>
<tr>
	<td>setSpeed</td>
	<td>150</td>
	<td></td>
</tr>
<tr>
	<td>store</td>
	<td>schoolout2@gmail.com</td>
	<td>UserLoginEmail</td>
</tr>
<tr>
	<td>store</td>
	<td>1q2w3e4r5t</td>
	<td>UserLoginPassword</td>
</tr>
<tr>
	<td>store</td>
	<td>3483</td>
	<td>N_stock</td>
</tr>
<!--Лоигн-->
<tr>
	<td>storeEval</td>
	<td>if (selenium.isElementPresent(&quot;id=input-login_mail&quot;)==true){nextMove=&quot;login&quot;} else {nextMove=&quot;exit&quot;}</td>
	<td>loginPage</td>
</tr>
<tr>
	<td>gotolabel</td>
	<td>${loginPage}</td>
	<td></td>
</tr>
<tr>
	<td>label</td>
	<td>exit</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>id=logout</td>
	<td></td>
</tr>
<tr>
	<td>label</td>
	<td>login</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>id=input-login_mail</td>
	<td>${UserLoginEmail}</td>
</tr>
<tr>
	<td>click</td>
	<td>css=input.button__button</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>id=loginMessages</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>css=#login-pass_view &gt; label.content__form__text__bg</td>
	<td></td>
</tr>
<tr>
	<td>type</td>
	<td>id=input-login_pass</td>
	<td>${UserLoginPassword}</td>
</tr>
<tr>
	<td>click</td>
	<td>css=input.button__button</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>css=div.all-sale</td>
	<td></td>
</tr>
<!--Выбор акции-->
<tr>
	<td>open</td>
	<td>/category/${N_stock}</td>
	<td></td>
</tr>
<!--Сохранение кол-ва товаров-->
<tr>
	<td>storeXpathCount</td>
	<td>//*[@id='product_listing']/div</td>
	<td>goods_count</td>
</tr>
<tr>
	<td>echo</td>
	<td>${goods_count}</td>
	<td></td>
</tr>
<tr>
	<td>store</td>
	<td>1</td>
	<td>goods_index</td>
</tr>
<!--Заходим на страницу товара-->
<tr>
	<td>clickAndWait</td>
	<td>//div[@id='product_listing']/div[${goods_index}]/p/a/img</td>
	<td></td>
</tr>
<tr>
	<td>label</td>
	<td>goods_page</td>
	<td></td>
</tr>
<!--Проверяем картинку-->
<tr>
	<td>store</td>
	<td>1</td>
	<td>i</td>
</tr>
<tr>
	<td>storeXpathCount</td>
	<td>//*[@id='pimages']/div[2]/a</td>
	<td>thumbnail_quantity</td>
</tr>
<tr>
	<td>echo</td>
	<td>${thumbnail_quantity}</td>
	<td></td>
</tr>
<tr>
	<td>gotoIf</td>
	<td>${thumbnail_quantity} != 1</td>
	<td>thumbnail_quantity_loop</td>
</tr>
<tr>
	<td>click</td>
	<td>css=div.mousetrap</td>
	<td></td>
</tr>
<tr>
	<td>pause</td>
	<td>2000</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>css=div.fancybox-item.fancybox-close</td>
	<td></td>
</tr>
<tr>
	<td>label</td>
	<td>thumbnail_quantity_loop</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>css=div.mousetrap</td>
	<td></td>
</tr>
<tr>
	<td>pause</td>
	<td>2000</td>
	<td></td>
</tr>
<tr>
	<td>while</td>
	<td>${i} &lt; ${thumbnail_quantity}</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>css=img.fancybox-image</td>
	<td></td>
</tr>
<tr>
	<td>pause</td>
	<td>2000</td>
	<td></td>
</tr>
<tr>
	<td>storeEval</td>
	<td>${i}+1</td>
	<td>i</td>
</tr>
<tr>
	<td>endWhile</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>css=div.fancybox-item.fancybox-close</td>
	<td></td>
</tr>
<!--Прожимаем на все характеристики-->
<tr>
	<td>store</td>
	<td>1</td>
	<td>size_index</td>
</tr>
<tr>
	<td>store</td>
	<td>1</td>
	<td>color_index</td>
</tr>
<tr>
	<td>storeEval</td>
	<td>if (selenium.isElementPresent(&quot;//div[@id='pinfo']/div/div[2]/div/ul/li[1]/label/input&quot;)==true){nextStap=&quot;true_goods_size&quot;} else {nextStap=&quot;false_goods_size&quot;}</td>
	<td>nextStap</td>
</tr>
<tr>
	<td>gotolabel</td>
	<td>${nextStap}</td>
	<td></td>
</tr>
<tr>
	<td>echo</td>
	<td>${nextStap}</td>
	<td></td>
</tr>
<tr>
	<td>label</td>
	<td>true_goods_size</td>
	<td></td>
</tr>
<tr>
	<td>storeXpathCount</td>
	<td>//*[@id='pinfo']/div[1]/div[2]/div[1]/ul/li</td>
	<td>size_goods_counter</td>
</tr>
<tr>
	<td>click</td>
	<td>//div[@id='pinfo']/div/div[2]/div/ul/li[${size_index}]/label/input</td>
	<td></td>
</tr>
<tr>
	<td>pause</td>
	<td>1400</td>
	<td></td>
</tr>
<tr>
	<td>while</td>
	<td>${size_index} &lt; ${size_goods_counter}</td>
	<td></td>
</tr>
<tr>
	<td>storeExpression</td>
	<td>${size_index}+1</td>
	<td>size_index</td>
</tr>
<tr>
	<td>click</td>
	<td>//div[@id='pinfo']/div/div[2]/div/ul/li[${size_index}]/label/input</td>
	<td></td>
</tr>
<tr>
	<td>endWhile</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>label</td>
	<td>false_goods_size</td>
	<td></td>
</tr>
<tr>
	<td>storeEval</td>
	<td>if (selenium.isElementPresent(&quot;name=temp_attr_id_color&quot;)==true){nextStap=&quot;true_color_size&quot;} else {nextStap=&quot;false_color_size&quot;}</td>
	<td>nextStap</td>
</tr>
<tr>
	<td>gotolabel</td>
	<td>${nextStap}</td>
	<td></td>
</tr>
<tr>
	<td>echo</td>
	<td>${nextStap}</td>
	<td></td>
</tr>
<tr>
	<td>label</td>
	<td>true_color_size</td>
	<td></td>
</tr>
<tr>
	<td>storeXpathCount</td>
	<td>//*[@id='pinfo']/div[1]/div[2]/div[2]/ul/li</td>
	<td>color_goods_counter</td>
</tr>
<tr>
	<td>click</td>
	<td>//div[@id='pinfo']/div/div[2]/div[2]/ul/li[${color_index}]</td>
	<td></td>
</tr>
<tr>
	<td>pause</td>
	<td>2000</td>
	<td></td>
</tr>
<tr>
	<td>while</td>
	<td>${color_index} &lt; ${color_goods_counter}</td>
	<td></td>
</tr>
<tr>
	<td>storeExpression</td>
	<td>${color_index}+1</td>
	<td>color_index</td>
</tr>
<tr>
	<td>echo</td>
	<td>${color_index}</td>
	<td></td>
</tr>
<tr>
	<td>click</td>
	<td>//div[@id='pinfo']/div/div[2]/div[2]/ul/li[${color_index}]</td>
	<td></td>
</tr>
<tr>
	<td>endWhile</td>
	<td></td>
	<td></td>
</tr>
<tr>
	<td>label</td>
	<td>false_color_size</td>
	<td></td>
</tr>
<!--Next goods-->
<tr>
	<td>while</td>
	<td>${goods_index} &lt; ${goods_count}</td>
	<td></td>
</tr>
<tr>
	<td>storeEval</td>
	<td>${goods_index}+1</td>
	<td>goods_index</td>
</tr>
<tr>
	<td>open</td>
	<td>/category/${N_stock}</td>
	<td></td>
</tr>
<tr>
	<td>waitForElementPresent</td>
	<td>//div[@id='product_listing']/div[${goods_index}]/p/a/img</td>
	<td></td>
</tr>
<tr>
	<td>clickAndWait</td>
	<td>//div[@id='product_listing']/div[${goods_index}]/p/a/img</td>
	<td></td>
</tr>
<tr>
	<td>gotolabel</td>
	<td>goods_page</td>
	<td></td>
</tr>
<tr>
	<td>endWhile</td>
	<td></td>
	<td></td>
</tr>

</tbody></table>
</body>
</html>
